package lab01;

/**
 * Created by 李晓容 on 2017/10/8.
 */
public class Test05 {
    public static void main(String[] args) {
        //for
        int n=100;
        int sum1=0;
        for (int i=1;i<=n;i++)
            sum1+=i;
        System.out.println(sum1);
        //while
        int m=100;
        int k=1,sum2=0;
        while (k<=m){
            sum2=sum2+k;
        }
        System.out.println(sum2);
        //do......while
        int x=1,sum3=0;
        int y=100;
        do {
            System.out.println(sum3=sum3+x);
        }
        while (x<=y);
    }
}
